﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
public partial class zoushitu_dlt_dlt_hzyl : System.Web.UI.Page
{
    protected List<Model.LotteryAnnouncement> arlist = null;
    protected string[] SSQList = null;
    protected string SSQblue = null;
    protected DataTable dtPaperList = new DataTable();
    //protected DataTable dtPaperList2 = new DataTable();
    protected Hashtable dtPageList2 = new Hashtable();
    protected int jinqiCount = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            jinqiCount = 30;
            bindData(30);
            YiLouZhi1(30);
        }
    }

    protected void bindData(int maxValue)
    {

        arlist = BLL.LotteryAnnouncement.getDatas(maxValue, 2);
        if (arlist != null)
        {
            #region

            dtPaperList.Columns.Add("Hezhi1", typeof(string));
            dtPaperList.Columns.Add("Hezhi2", typeof(string));
            dtPaperList.Columns.Add("Hezhi3", typeof(string));
            dtPaperList.Columns.Add("Hezhi4", typeof(string));
            dtPaperList.Columns.Add("Hezhi5", typeof(string));
            dtPaperList.Columns.Add("Hezhi6", typeof(string));
            dtPaperList.Columns.Add("Hezhi7", typeof(string));
            dtPaperList.Columns.Add("Hezhi8", typeof(string));
            dtPaperList.Columns.Add("Hezhi9", typeof(string));
            dtPaperList.Columns.Add("Hezhi10", typeof(string));
            dtPaperList.Columns.Add("Hezhi11", typeof(string));
            dtPaperList.Columns.Add("Hezhi12", typeof(string));
            dtPaperList.Columns.Add("Hezhi13", typeof(string));
            dtPaperList.Columns.Add("Hezhi14", typeof(string));
            dtPaperList.Columns.Add("Hezhi15", typeof(string));
            dtPaperList.Columns.Add("Hezhi16", typeof(string));
            dtPaperList.Columns.Add("Hezhi17", typeof(string));
            dtPaperList.Columns.Add("Hezhi18", typeof(string));
            dtPaperList.Columns.Add("Hezhi19", typeof(string));
            dtPaperList.Columns.Add("Hezhi20", typeof(string));
            dtPaperList.Columns.Add("Hezhi21", typeof(string));
            dtPaperList.Columns.Add("Hezhi22", typeof(string));
            dtPaperList.Columns.Add("Hezhi23", typeof(string));
            dtPaperList.Columns.Add("Hezhi24", typeof(string));
            dtPaperList.Columns.Add("Hezhi25", typeof(string));
            dtPaperList.Columns.Add("Hezhi26", typeof(string));
            dtPaperList.Columns.Add("Hezhi27", typeof(string));

            dtPageList2.Add(27, "Hezhi27");
            dtPageList2.Add(26, "Heizhi26");
            dtPageList2.Add(25, "Heizhi25");
            dtPageList2.Add(24, "Heizhi24");
            dtPageList2.Add(23, "Heizhi23");
            dtPageList2.Add(22, "Heizhi22");
            dtPageList2.Add(21, "Heizhi21");
            dtPageList2.Add(20, "Heizhi20");
            dtPageList2.Add(19, "Heizhi19");
            dtPageList2.Add(18, "Heizhi18");
            dtPageList2.Add(17, "Heizhi17");
            dtPageList2.Add(16, "Heizhi16");
            dtPageList2.Add(15, "Heizhi15");
            dtPageList2.Add(14, "Heizhi14");
            dtPageList2.Add(13, "Heizhi13");
            dtPageList2.Add(12, "Heizhi12");
            dtPageList2.Add(11, "Heizhi11");
            dtPageList2.Add(10, "Heizhi10");
            dtPageList2.Add(9, "Heizhi9");
            dtPageList2.Add(8, "Heizhi8");
            dtPageList2.Add(7, "Heizhi7");
            dtPageList2.Add(6, "Heizhi6");
            dtPageList2.Add(5, "Heizhi5");
            dtPageList2.Add(4, "Heizhi4");
            dtPageList2.Add(3, "Heizhi3");
            dtPageList2.Add(2, "Heizhi2");
            dtPageList2.Add(1, "Heizhi1");
            #endregion
            for (int i = 0; i < arlist.Count; i++)
            {
                int hezhi = 0;//和值 
                string[] redBall = arlist[i].LotteryNo.Split('+')[0].Split(',');
                for (int m = 0; m < redBall.Length; m++)
                {
                    hezhi += int.Parse(redBall[m]);
                }

                //绑定和值
                bindHezhi(hezhi, int.Parse(hezhi.ToString().Substring(hezhi.ToString().Length - 1, 1)));

                //计算条形图中每个数的个数
                bindTiaoxing(hezhi, int.Parse(hezhi.ToString().Substring(hezhi.ToString().Length - 1, 1)));
            }
        }
    }
    protected int[] hezhiDt = new int[25];
    /// <summary>
    /// 绑定和值 和值尾数到一个新的datatable
    /// </summary>
    /// <param name="data">和值</param>
    /// <param name="dataLast">和值尾数</param>
    protected void bindHezhi(int data, int dataLast)
    {
        DataRow newRow = dtPaperList.NewRow();
        if (data <= 40)
        {
            #region
            newRow["Hezhi1"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 41 && data < 46)
        {
            #region
            newRow["Hezhi2"] = data.ToString();
            newRow["Hezhi1"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 46 && data < 51)
        {
            #region
            newRow["Hezhi3"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 51 && data < 56)
        {
            #region
            newRow["Hezhi4"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 56 && data < 61)
        {
            #region
            newRow["Hezhi5"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 61 && data < 66)
        {
            #region
            newRow["Hezhi6"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 66 && data < 71)
        {
            #region
            newRow["Hezhi7"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 71 && data < 76)
        {
            #region
            newRow["Hezhi8"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 76 && data < 81)
        {
            #region
            newRow["Hezhi9"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 81 && data < 86)
        {
            #region
            newRow["Hezhi10"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 86 && data < 91)
        {
            #region
            newRow["Hezhi11"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 91 && data < 96)
        {
            #region
            newRow["Hezhi12"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 96 && data < 101)
        {
            #region
            newRow["Hezhi13"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 101 && data < 106)
        {
            #region
            newRow["Hezhi14"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 106 && data < 111)
        {
            #region
            newRow["Hezhi15"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 111 && data < 116)
        {
            #region
            newRow["hezhi16"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 116 && data < 121)
        {
            #region
            newRow["hezhi17"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 121 && data < 126)
        {
            #region
            newRow["hezhi18"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 126 && data < 131)
        {
            #region
            newRow["hezhi19"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 131 && data < 136)
        {
            #region
            newRow["hezhi20"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 136 && data < 141)
        {
            #region
            newRow["hezhi21"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 141 && data < 146)
        {
            #region
            newRow["hezhi22"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 146 && data < 151)
        {
            #region
            newRow["hezhi23"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 151 && data < 156)
        {
            #region
            newRow["hezhi24"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 156 && data < 161)
        {
            #region
            newRow["hezhi25"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data > 161 && data < 166)
        {
            #region
            newRow["hezhi26"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi1"] = "0";
            newRow["Hezhi27"] = "0";
            #endregion
        }
        else if (data >= 166)
        {
            #region
            newRow["hezhi27"] = data.ToString();
            newRow["Hezhi2"] = "0";
            newRow["Hezhi3"] = "0";
            newRow["Hezhi4"] = "0";
            newRow["Hezhi5"] = "0";
            newRow["Hezhi6"] = "0";
            newRow["Hezhi7"] = "0";
            newRow["Hezhi8"] = "0";
            newRow["Hezhi9"] = "0";
            newRow["Hezhi10"] = "0";
            newRow["Hezhi11"] = "0";
            newRow["Hezhi12"] = "0";
            newRow["Hezhi13"] = "0";
            newRow["Hezhi14"] = "0";
            newRow["Hezhi15"] = "0";
            newRow["Hezhi16"] = "0";
            newRow["Hezhi17"] = "0";
            newRow["Hezhi18"] = "0";
            newRow["Hezhi19"] = "0";
            newRow["Hezhi20"] = "0";
            newRow["Hezhi21"] = "0";
            newRow["Hezhi22"] = "0";
            newRow["Hezhi23"] = "0";
            newRow["Hezhi24"] = "0";
            newRow["Hezhi25"] = "0";
            newRow["Hezhi26"] = "0";
            newRow["Hezhi1"] = "0";
            #endregion
        }
        dtPaperList.Rows.Add(newRow);
    }
    private int ReturnValue(int data)
    {
        int values = 0;
        if (data <= 40)
        {
            values = 1;
        }
        else if (data >= 41 && data < 46)
        {
            values = 2;
        }
        else if (data >= 46 && data < 51)
        {
            values = 3;
        }
        else if (data >= 51 && data < 56)
        {
            values = 4;
        }
        else if (data >= 56 && data < 61)
        {
            values = 5;
        }
        else if (data >= 61 && data < 66)
        {
            values = 6;
        }
        else if (data >= 66 && data < 71)
        {
            values = 7;
        }
        else if (data >= 71 && data < 76)
        {
            values = 8;
        }
        else if (data >= 76 && data < 81)
        {
            values = 9;
        }
        else if (data >= 81 && data < 86)
        {
            values = 10;
        }
        else if (data >= 86 && data < 91)
        {
            values = 11;
        }
        else if (data >= 91 && data < 96)
        {
            values = 12;
        }
        else if (data >= 96 && data < 101)
        {
            values = 13;
        }
        else if (data >= 101 && data < 106)
        {
            values = 14;
        }
        else if (data >= 106 && data < 111)
        {
            values = 15;
        }
        else if (data >= 111 && data < 116)
        {
            values = 16;
        }
        else if (data >= 116 && data < 121)
        {
            values = 17;
        }
        else if (data >= 121 && data < 126)
        {
            values = 18;
        }
        else if (data >= 126 && data < 131)
        {
            values = 19;
        }
        else if (data >= 131 && data < 136)
        {
            values = 20;
        }
        else if (data >= 136 && data < 141)
        {
            values = 21;
        }
        else if (data >= 141 && data < 146)
        {
            values = 22;
        }
        else if (data >= 146 && data < 151)
        {
            values = 23;
        }
        else if (data >= 151 && data < 156)
        {
            values = 24;
        }
        else if (data >= 156 && data < 161)
        {
            values = 25;
        }
        else if (data > 161 && data < 166)
        {
            values = 26;
        }
        else if (data >= 166)
        {
            values = 27;
        }
        return values;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        jinqiCount = int.Parse(DropDownList1.SelectedValue);
        bindData(int.Parse(DropDownList1.SelectedValue));
        YiLouZhi1(int.Parse(DropDownList1.SelectedValue));
    }
    protected int[] TiaoxingDT = new int[27];
    /// <summary>
    /// 绑定条形码
    /// </summary>
    /// <param name="data">和值</param>
    /// <param name="datalast">和值尾数</param>
    protected void bindTiaoxing(int data, int datalast)
    {
        if (data < 40)
        {
            TiaoxingDT[0] += 1;
        }
        else if (data >= 41 && data < 46)
        {
            TiaoxingDT[1] += 1;
        }
        else if (data >= 46 && data < 51)
        {
            TiaoxingDT[2] += 1;
        }
        else if (data >= 51 && data < 56)
        {
            TiaoxingDT[3] += 1;
        }
        else if (data >= 56 && data < 61)
        {
            TiaoxingDT[4] += 1;
        }
        else if (data >= 61 && data < 66)
        {
            TiaoxingDT[5] += 1;
        }
        else if (data >= 66 && data < 71)
        {
            TiaoxingDT[6] += 1;
        }
        else if (data >= 71 && data < 76)
        {
            TiaoxingDT[7] += 1;
        }
        else if (data >= 76 && data < 81)
        {
            TiaoxingDT[8] += 1;
        }
        else if (data >= 81 && data < 86)
        {
            TiaoxingDT[9] += 1;
        }
        else if (data >= 86 && data < 91)
        {
            TiaoxingDT[10] += 1;
        }
        else if (data >= 91 && data < 96)
        {
            TiaoxingDT[11] += 1;
        }
        else if (data >= 96 && data < 101)
        {
            TiaoxingDT[12] += 1;
        }
        else if (data >= 101 && data < 106)
        {
            TiaoxingDT[13] += 1;
        }
        else if (data >= 106 && data < 111)
        {
            TiaoxingDT[14] += 1;
        }
        else if (data >= 111 && data < 116)
        {
            TiaoxingDT[15] += 1;
        }
        else if (data >= 116 && data < 121)
        {
            TiaoxingDT[16] += 1;
        }
        else if (data >= 121 && data < 126)
        {
            TiaoxingDT[17] += 1;
        }
        else if (data >= 126 && data < 131)
        {
            TiaoxingDT[18] += 1;
        }
        else if (data >= 131 && data < 136)
        {
            TiaoxingDT[19] += 1;
        }
        else if (data >= 136 && data < 141)
        {
            TiaoxingDT[20] += 1;
        }
        else if (data >= 141 && data < 146)
        {
            TiaoxingDT[21] += 1;
        }
        else if (data >= 146 && data < 151)
        {
            TiaoxingDT[22] += 1;
        }
        else if (data >= 151 && data < 156)
        {
            TiaoxingDT[23] += 1;
        }
        else if (data >= 156 && data < 161)
        {
            TiaoxingDT[24] += 1;
        }
        else if (data >= 161 && data < 166)
        {
            TiaoxingDT[25] += 1;
        }
        else if (data >= 166)
        {
            TiaoxingDT[26] += 1;
        }

    }

    #region 遗漏用到的变量   
    protected List<List<List<string>>> Ylist = new List<List<List<string>>>();
    #endregion
    public void YiLouZhi1(int maxValue)
    {
        arlist = BLL.LotteryAnnouncement.getDatas(maxValue, 2);
        if (arlist == null || arlist.Count < 0) return;
        List<List<string>> winList = new List<List<string>>();//记录和值和中奖期数
        for (int i = 0; i < arlist.Count; i++)
        {
            string qs = arlist[i].LotteryQS;
            string[] redBall = arlist[i].LotteryNo.Split('+')[0].Split(',');
            int hezhi = 0;//和值 
            for (int m = 0; m < redBall.Length; m++)
            {
                hezhi += int.Parse(redBall[m]);
            }

            List<List<string>> yiLouList = new List<List<string>>();
            string lotteryQS = arlist[i].LotteryQS;//开奖期数

            for (int c = 1; c < 28; c++)
            {
                string NewQS = "";
                if (i == 0)
                {
                    NewQS = arlist[0].LotteryQS;
                }
                else
                {
                    for (int m = 0; m < winList.Count; m++)
                    {
                        if (winList[m][1] == c.ToString())
                        {
                            if (winList[m][0] == arlist[0].LotteryQS)
                            {
                                NewQS = (int.Parse(arlist[i].LotteryQS) - (i + 1)).ToString();
                            }
                            else
                            {
                                NewQS = winList[m][0];
                            }

                        }
                    }
                    if (NewQS == "")
                    {
                        NewQS = arlist[0].LotteryQS;
                    }
                }

                if (c == ReturnValue(hezhi))//命中
                {
                    List<string> list = new List<string>();
                    list.Add(lotteryQS);
                    list.Add(c.ToString());
                    list.Add("mz");
                    yiLouList.Add(list);
                    List<string> list1 = new List<string>();
                    list1.Add(lotteryQS);
                    list1.Add(c.ToString());
                    list1.Add("mz");
                    winList.Add(list1);
                }
                else//遗漏
                {
                    int MissingQS = 0;
                    List<string> list = new List<string>();

                    if (NewQS == arlist[0].LotteryQS)//第一行
                    {
                        MissingQS = Convert.ToInt32(lotteryQS) - Convert.ToInt32(NewQS) + 1;
                    }
                    else
                    {
                        for (int m = 0; m < winList.Count; m++)
                        {
                            if (winList[m][1] == c.ToString())
                            {
                                if (winList[m][0] == arlist[0].LotteryQS)
                                {
                                    NewQS = (int.Parse(arlist[i].LotteryQS) - i).ToString();
                                }
                                else
                                {
                                    NewQS = winList[m][0];
                                }

                            }
                        }
                        MissingQS = Convert.ToInt32(lotteryQS) - Convert.ToInt32(NewQS);//遗漏期数
                    }
                    list.Add(lotteryQS);
                    list.Add(c.ToString());
                    list.Add(MissingQS.ToString());
                    yiLouList.Add(list);
                }

            }
            Ylist.Add(yiLouList);
        }

    }
}